<?php
namespace Goatherd\Content\Engine\Reader;

use Goatherd\Content\Engine\Queue\IItem;

/**
 * Defered reader execution.
 * To be used with IReader implementations.
 *
 */
trait DeferedReaderTrait
{
    /**
     * Deferes parent::get(IItem) using closure.
     *
     * @param IItem $item
     * @return ResourceContainer
     */
    public function get(IItem $item)
    {
        return DeferedReaderContainer::createResourceContainer($this, $item);
    }

    /**
     *
     * @param IItem $item
     * @return ResourceContainer
     */
    public function getDefered(IItem $item)
    {
        return parent::get($item);
    }
}
